package cn.itcast.collection

import scala.collection.{immutable, mutable}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

/**
  * @Package cn.itcast.collection
  * @author KTL
  * @date 2021/5/15 0015 15:23
  * @version V1.0
  * @Copyright © 2015-04-29  One for each, and two for each
  *           Desc 演示scala中List中基本使用-
  */
object Demo02_Seq_List {
  def main(args: Array[String]): Unit = {
    val list: List[Int] =List(1,2,3,4)
    val list2: List[Int]=1::2::3::Nil //nil表示一个空列表
    println(list)
    println(list2)


    var list3 =ListBuffer[Int]()
    var list4 =ListBuffer(1,2,3)
    list4.append(4)
    println(list4)

    val result =list3++=list4
    println(result)
  }
}
